package com.hqyj.utile;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class SaveUtile {
    private static void saveFile(String filename,byte[]data){
        if(data!=null){
            String filepath="D:\\"+filename;
            File file=new File(filepath);
            if(file.exists()){
                file.delete();
            }
            FileOutputStream fos= null;
            try {
                fos = new FileOutputStream(file);
                fos.write(data,0,data.length);
                fos.flush();
                fos.close();
            } catch (FileNotFoundException e) {
                e.printStackTrace();

            } catch (IOException e) {
                e.printStackTrace();
            }

        }
    }


}
